package com.pucong.gitee.database.backup.common.entity.database;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.pucong.gitee.database.backup.common.selfenum.CommonBoolenEnum;
import com.pucong.gitee.database.backup.common.selfenum.DatabaseTaskStatusEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

@Data
@TableName("AUTO_TASK")
@ApiModel("备份任务表")
public class BackupTask implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "UUID",type = IdType.INPUT)
    @ApiModelProperty("主键")
    private String uuid;

    @TableField("TASK_NAME")
    @ApiModelProperty("任务名称")
    private String taskName;

    @TableField("TASK_TYPE")
    @ApiModelProperty("任务类型")
    private String taskType;

    @TableField("DATABASE_ID")
    @ApiModelProperty("数据库id")
    private String databaseId;

    @TableField("CRON_YEAR")
    @ApiModelProperty("年")
    private String cronYear;

    @TableField("CRON_MONTH")
    @ApiModelProperty("月")
    private String cronMonth;

    @TableField("CRON_DAY")
    @ApiModelProperty("日")
    private String cronDay;

    @TableField("CRON_WEEK")
    @ApiModelProperty("周")
    private String cronWeek;

    @TableField("CRON_HOUR")
    @ApiModelProperty("时")
    private String cronHour;

    @TableField("CRON_MINNE")
    @ApiModelProperty("分")
    private String cronMinne;

    @TableField("CRON_SECOND")
    @ApiModelProperty("秒")
    private String cronSecond;

    @TableField("DATABASE_FILE_PATH")
    @ApiModelProperty("备份文件地址")
    private String databaseFilePath;

    @TableField("DESCRIPTION")
    @ApiModelProperty("描述")
    private String description;

    @TableField("CREATE_TIME")
    @ApiModelProperty("创建时间")
    private Date createTime;

    @TableField("ENABLED")
    @ApiModelProperty("是否启用")
    private CommonBoolenEnum enabled;

    @TableField("PROGRESS_STATUS")
    @ApiModelProperty("执行状态")
    private DatabaseTaskStatusEnum progressStatus;
}
